package com.aode.music.viewmodel;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData;

import com.aode.common.bean.request.SearchData;
import com.aode.common.bean.response.Music;
import com.aode.common.bean.web.Page;
import com.aode.common.bean.web.Result;
import com.aode.music.repository.WebRepository;

public class MusicViewModel extends AndroidViewModel {
    private WebRepository repository;
    public MusicViewModel(@NonNull Application application) {
        super(application);
        this.repository = new WebRepository(application);
    }

    public void getMusic(SearchData searchData){
        repository.getMusic1(searchData);
    }


    public MutableLiveData<Result<Page<Music>>> getMusicLiveData(){
        return repository.getMusicLiveData1();
    }
}
